#include <stdio.h>
#include <string.h>

#define MAXCAP 1024
#define NONE_FLUSH (1<<1)//不缓冲
#define LINE_FLUSH (1<<2)//行缓冲 
#define FULL_FLUSH (1<<3) //全缓冲


typedef struct MyFILE
{
    char buffer[MAXCAP];//缓冲区
    int pos;//存储了多少数据
    int cap;//容量是多少
    int fileno;
    int flushmode;//刷新模式

}MyFILE;


MyFILE* my_fopen(const char *path, const char *mode);

void my_fflush(MyFILE* fp);

size_t my_fwrite(const void *ptr, size_t size,MyFILE *fp);

void my_fclose(MyFILE *fp);




